package com.wangzh.concurrent;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.concurrent.CopyOnWriteArrayList;

public class TestList {
    public static void main(String[] args) {
        ConcurrentHashMap<String, String> map = new ConcurrentHashMap<>(0);
        map.put("a", "a");
        map.put("a", "b");

        CopyOnWriteArrayList<String> list = new CopyOnWriteArrayList<>();

        list.add("a");
        list.add("b");
        System.out.println(list);

        ConcurrentLinkedDeque<String> linkedDeque = new ConcurrentLinkedDeque<>();
        linkedDeque.add("s");
        linkedDeque.add("e");
        System.out.println(linkedDeque);

        flag1:
        for(;;){
            for (int i = 0; i < 10; i++) {
                if (i==5){
                    break flag1;
                }
                System.out.println(2);
            }
            System.out.println(1);
        }
    }
}
